package main

import (
	"fmt"
	dysmsapi "github.com/aliyun/alibaba-cloud-sdk-go/services/dysmsapi"
)

func main() {
	client, err := dysmsapi.NewClientWithAccessKey("cn-beijing", "<your-access-key-id>", "<your-access-key-secret>")
	/* use STS Token
	client, err := dysmsapi.NewClientWithStsToken("cn-beijing", "<your-access-key-id>", "<your-access-key-secret>", "<your-sts-token>")
	*/

	request := dysmsapi.CreateSendSmsRequest()
	request.Scheme = "https"

	request.SignName = "阿里云短信测试"
	request.TemplateCode = "SMS_154950909"
	request.PhoneNumbers = "13639690376"
	request.TemplateParam = "{\"code\":\"1234\"}"

	response, err := client.SendSms(request)
	if err != nil {
		fmt.Print(err.Error())
	}
	fmt.Printf("response is %#v\n", response)
}
